import java.util.Scanner;

public class Main {
	private static String getResult(int[][] refOX) {
		for(int i = 0; i < refOX.length; i++) {
			for(int j = 0; j < refOX[i].length; j++) {
				refOX[i][j] *= refOX[i][j];
			}
		}
		
		String result = "Tie\n";
		int slhR = refOX[0][0] + refOX[1][1] + refOX[2][2];
		int slhL = refOX[0][2] + refOX[1][1] + refOX[2][0];
		int row;
		int[] col = new int[refOX.length];

		if(slhR == 3)
			return "Y bingle\n";
		else if(slhR == 12)
			return "X bingle\n";
		
		if(slhL == 3)
			return "Y bingle\n";
		else if(slhL == 12)
			return "X bingle\n";

		for(int i = 0; i < refOX.length; i++)
			col[i] = 0;
		
		for(int i = 0; i < refOX.length; i++) {
			row = 0;
			for(int j = 0; j < refOX[i].length; j++) {
				row += refOX[i][j];
				col[i] += refOX[i][j];
			}
			if(row == 3)
				return "Y bingle\n";
			else if(row == 12)
				return "X bingle\n";
		}
		
		for(int i = 0; i < refOX.length; i++) {
			if(col[i] == 3)
				return "Y bingle\n";
			else if(col[i] == 12)
				return "X bingle\n";
		}

		return result;
	}
	private static String getToken(int n) {
		String[] token = new String[] {"*", "Y", "X"};
		return token[n];
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String output;
		int[][] ox;
		int n;

		while(sc.hasNext()) {
			output = "";
			ox = new int[3][3];
			for(int i = 0; i < ox.length; i++) {
				for(int j = 0; j < ox[i].length; j++) {
					ox[i][j] = sc.nextInt();
					output += getToken(ox[i][j]);
				}
				output += '\n';
			}
			
			output += getResult(ox);
			
			System.out.print(output);
		}
	}
	
}